package com.fanrenqiji.modules.sys.dao;

import com.fanrenqiji.common.persistence.BaseDao;
import com.fanrenqiji.common.persistence.BaseDaoImpl;
import com.fanrenqiji.modules.sys.entity.Dict;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author lijian E-mail:ljz0721cx@163.com
 * @version 创建时间：2015年1月22日 上午11:44:12
 * @description 数据字典表 记录系统的数据词
 */
public interface DictDao extends DictDaoCustom, CrudRepository<Dict, Long> {

	@Query("from Dict where delFlag='" + Dict.DEL_FLAG_NORMAL + "' order by sort")
	public List<Dict> findAllList();
	
	@Query("select type from Dict where delFlag='" + Dict.DEL_FLAG_NORMAL + "' group by type")
	public List<String> findTypeList();

}


interface DictDaoCustom extends BaseDao<Dict> {
}

@Repository
class DictDaoImpl extends BaseDaoImpl<Dict> implements DictDaoCustom {

}
